package com.haha.im.presenter

import android.view.View
import com.haha.im.contract.SplashContract
import com.hyphenate.chat.EMClient

class SplashPresenter(val view: SplashContract.View) :SplashContract.Presenter{
    override fun checkLoginStatus() {
        if (isLoggedIn())   view.onLoggedIn()
        else view.onNotLoggedIn()
    }

    //是否登录到环信的SDK
    private fun isLoggedIn(): Boolean =
        EMClient.getInstance().isConnected && EMClient.getInstance().isLoggedInBefore

}